<template>
  <div>
    <div class="box">
      <MyDog></MyDog>
      <MyDog></MyDog>
    </div>
    <div class="box2">
      <MyDog2></MyDog2>
      <MyDog2></MyDog2>
      <MyDog2></MyDog2>
      <MyDog2></MyDog2>
    </div>
    <div class="box">
      <MyDog3
        v-for="(item, index) in list"
        :key="index"
        :dogImgUrl="item.dogImgUrl"
        :dogName="item.dogName"
      ></MyDog3>
    </div>
    <div class="box4">
      <MyDog4
        v-for="(item, index) in list"
        :key="index"
        :dogImgUrl="item.dogImgUrl"
        :dogName="item.dogName"
        @love="love"
      ></MyDog4>
      <p>你喜欢的小狗</p>
      <ul>
        <li v-for="(item, index) in lovelist" :key="index">{{ item }}</li>
      </ul>
    </div>
  </div>
</template>

<script>
import MyDog from "./components/MyDog.vue";
import MyDog2 from "./components/MyDog2.vue";
import MyDog3 from "./components/MyDog3.vue";
import MyDog4 from "./components/MyDog4.vue";
export default {
  name: "App",
  components: {
    MyDog,
    MyDog2,
    MyDog3,
    MyDog4,
  },
  props: {},
  data() {
    return {
      list: [
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1224576619,1307855467&fm=26&gp=0.jpg",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2967740259,1518632757&fm=26&gp=0.jpg",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563813435580&di=946902d419c3643e33a0c9113fc8d780&imgtype=0&src=http%3A%2F%2Fvpic.video.qq.com%2F3388556%2Fd0522aynh3x_ori_3.jpg",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563813454815&di=ecdd2ebf479568453d704dffacdfa12c&imgtype=0&src=http%3A%2F%2Fwww.officedoyen.com%2Fuploads%2Fallimg%2F150408%2F1-15040Q10J5B0.jpg",
          dogName: "萨摩耶",
        },
      ],
      lovelist: [],
      goodsArr: [
        {
          count: 0,
          goodsName: "Watermelon",
        },
        {
          count: 0,
          goodsName: "Banana",
        },
        {
          count: 0,
          goodsName: "Orange",
        },
        {
          count: 0,
          goodsName: "Pineapple",
        },
        {
          count: 0,
          goodsName: "Strawberry",
        },
      ],
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    love(dogName) {
      this.lovelist.push(dogName);
    },
  },
};
</script>

<style scoped></style>
